LoadItems = classlite();

function LoadItems:ctor()
	self.error 			= false;
	self.resources		= {};
end

function LoadItems:reset()
	self.error 		= false;
	self.errorFileName 	= nil;
	self.resources		= {};
end

function LoadItems:hasError()
	return self.error;
end

function LoadItems:getErrorFile()
	return self.errorFile;
end

function LoadItems:setErrorFile(filename)
	self.error = true;
	self.errorFile=filename;
end

function LoadItems:addData(id, type, data)
	self.resources[id] = { type=type, data=data };
end

function LoadItems:forEach(func)
	for id,data in pairs(self.resources) do
		func(id, data.type, data.data);
	end
end

function LoadItems:getData(id)
	local data = self.resources[id];
	if data ~= nil then return data.data 
	else cclog("id=" .. id .. " is null"); return nil end
end

function LoadItems:getDataType(id)
	local data = self.resources[id];
	if data ~= nil then return data.type 
	else return nil end
end
